<?php
if(isset($_COOKIE['login']))
{ 
    $content = new Models_User();
    $userData = $content->getUserData($_COOKIE['user_id']);
    $path = new Access_Db();
?>
<div class="well">
    <div class="row">
        <div class="span1"><a href="#" class="thumbnail"><img src="/<?php $content->printPath(); ?>public/img/user/userpic.jpg" alt="user"></a></div>
            <div class="span7">
                <p><i class="icon-user"></i> <?php echo $_COOKIE['login']; ?></p>
                <strong><p><?php echo $userData['first_name'] . '  ' . $userData['second_name']; ?></p></strong>
                <div class="form-horizontal">
                      <div class="control-group">
                        <label class="control-label">e-mail:</label>
                        <div class="controls">
                            <span class="input-xlarge uneditable-input" style="cursor: default;"><?php echo $userData['email']; ?></span>
                        </div>
                      </div>
                     <div class="control-group">
                        <label class="control-label">skype:</label>
                        <div class="controls">
                            <span class="input-xlarge uneditable-input" style="cursor: default;"><?php echo $userData['skype']; ?></span>
                        </div>
                      </div>
                     <div class="control-group">
                        <label class="control-label">icq:</label>
                        <div class="controls">
                            <span class="input-xlarge uneditable-input" style="cursor: default;"><?php echo $userData['icq']; ?></span>
                        </div>
                      </div>
                      <div class="control-group">
                          <div class="well"><?php echo $userData['info']; ?></div>
                      </div>
                     <div class="form-actions">
                         <a class="btn btn-primary" href="/<?php $content->printPath() ?>user/edit"><i class="icon-pencil"></i> Edit</a>
                      </div>
                  </div>
            </div>
    </div>
</div>
<?php
    } else {
?>
<div class="alert alert-info"><h4>Welcome, guest. Login or register, please.</h4></div>
<div class="row">
    <div class="span6">
        <div class="well">
            <div class="well">
                <form method="POST" class="form-horizontal" action="/">
                    <legend>Logining:</legend>
                    <fieldset class="">
                        <div class="control-group">
                            <label class="control-label">Username or email:</label>
                            <div class="controls">
                                <input id="" class="span2" name="login" value="" type="text" placeholder="Username" />
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">Password:</label>
                            <div class="controls">
                                <input id="" class="span2" name="password" value="" type="password" placeholder="Password" />
                            </div>
                        </div>
                        <div class="form-actions">
                            <input class="btn btn-success submit" type="submit" name="submit_login" value="Sign in" />
                            <a class="forgot" href="/user/restore">Forgot your password?</a>
                        </div>
                    </fieldset>
                </form>
             </div>
        </div>
    </div>
    <div class="span3">
        <img style="margin: 60px 70px;" src="/public/img/user/key.png" />
    </div>
</div>
<?php
    }
?>